<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/extras/importer/linux_perf/ftrace_importer.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  test('drmImport', function() {
    const lines = [
      ' chrome-2465  [000]    71.653157: drm_vblank_event: crtc=0, seq=4233',
      ' <idle>-0     [000]    71.669851: drm_vblank_event: crtc=0, seq=4234'
    ];
    const m = tr.c.TestUtils.newModelWithEvents([lines.join('\n')], {
      shiftWorldToZero: false
    });
    assert.isFalse(m.hasImportWarnings);

    const threads = m.getAllThreads();
    assert.strictEqual(threads.length, 1);

    const vblankThread = threads[0];
    assert.strictEqual(vblankThread.name, 'drm_vblank');
    assert.strictEqual(vblankThread.sliceGroup.length, 2);
  });
});
</script>

